//
//  Order.m
//  Courses
//
//  Created by xxx on 15/1/19.
//  Copyright (c) 2015年 wtf. All rights reserved.
//

#import "Order.h"
#import "Request.h"

@implementation Order

+ (BOOL)getOrderByUserId:(NSString *)userId orderId:(NSString *)orderId
{
    Request *request = [Request requestWithName:@"submit_order"];
//    "sourceId":"2",
//    "deviceNo":"IOS12345",
//    "version":"v1.0.0" ,
//    "userId":"id001",
//    "classId":"cid001",                    //班级id
//    "orderAmount":"3200.00",             // 订单总额
//    "realAmount":"2500.00",              // 实付金额
//    "discount":"700.00",                  // 优惠金额
//    "mobile":"134111111",                //下订单时填写的手机号
//    "salesCode":"张三",                   // 课程顾问
//    "invoiceTitle":"个人",                // 发票抬头
//    "invoiceAddress":"上海市虹口区xxxx"  // 发票地址

    request.body[@"userId"] = @"1DA4E06E79144847B7D227820FCD6F67";
    request.body[@"version"] = @"v1.0.0";
    request.body[@"userId"] = @"id001";
    request.body[@"orderId"] = @"20141230181921005";
    request.body[@"tradeRtn:"] = @"";           //TODO
    
    NSMutableDictionary *tradeMsg = [[NSMutableDictionary alloc] init];
    tradeMsg[@"paymentNo"] = @"20141230181921005";
    tradeMsg[@"realAmount"] = @"2500";
    tradeMsg[@"tradeAmount"] = @"2500";
    tradeMsg[@"buyerUserId"] = @"aaa@a.com";
    tradeMsg[@"tradeTime"] = @"2014-12-30 18:19:21";
    request.body[@"tradeMsg"] = tradeMsg;

    Response *response = [request response];
    
    return response.result;
}

@end
